/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.srgsxmldb.test;

import cz.muni.fi.pb138.srgsxmldb.database.BaseXDBFactory;
import java.util.ResourceBundle;
import org.basex.core.BaseXException;
import org.basex.core.Context;
import org.basex.core.cmd.CreateDB;

/**
 * 
 * @author Eldred
 */
public final class CreateCollection {
  /**
   * Runs the code creating baseX collection from xml files in database folder
   * @param args (ignored) command-line arguments
   * @throws BaseXException if a database command fails
   */
  public static void main(final String[] args) throws BaseXException {
    // Create database context
    Context context = new Context();
    
    ResourceBundle rb = ResourceBundle.getBundle("cz.muni.fi.pb138.srgsxmldb.properties/baseXdatabase");

    new CreateDB(rb.getString("collectionName"), rb.getString("databaseLocation")+rb.getString("databaseAddress")).execute(context);
    
    BaseXDBFactory.closeCollection(context);

    context.close();
  }
}